import store from '@/store';
import {
    getInfoDetailsService,
    getJobRecordService
} from '../service';


/**
 * 获取职位详情页的数据
 */
export async function getInfoDetails(payload = {}) {
    const allData = await getInfoDetailsService(payload);

    if (allData.code >= 2000 && allData.code < 4000) {
        store.commit('setInfoDetails', allData.data); // 将获取到的数据值存到store中
    }
    return allData;
}

/**
 * 获取求职记录
 */
export async function getJobRecord(payload = {}) {
    const allData = await getJobRecordService(payload);
    if (allData.code >= 2000 && allData.code < 4000) {
        store.commit('setJobRecordList', allData.data); // 将获取到的数据值存到store中
    }
    return allData;
}